package com.jphoebe.plugin.mybatis.utils;

import cn.hutool.core.io.resource.ClassPathResource;
import cn.hutool.setting.Setting;
import cn.hutool.setting.dialect.Props;

/**
 * PropertiesUtil class
 *
 * @author 蒋时华
 * @date 2019/2/18
 */
public class PropertiesUtil {

    public static Setting getPluginContextProps(){
        return PropertiesUtil.getPorps("prop/PluginContext.properties");
    }

    public static Setting getPluginProps(){
        return PropertiesUtil.getPorps("prop/PluginProp.properties");
    }

    public static Setting getPorps(String filePATH){
        ClassPathResource classPathResource = new ClassPathResource(filePATH, PropertiesUtil.class.getClassLoader());
        Setting setting = new Setting();
        setting.init(classPathResource, Setting.DEFAULT_CHARSET, false);
        return setting;
    }

}
